import { createStore, combineReducers } from "redux";
import { persistStore, persistReducer } from "redux-persist";
import storage from "redux-persist/lib/storage"; // defaults to localStorage for web
import { CollapsedReducer } from "./reducers/CollapsedReducer";
import { Login } from "./reducers/Login";
import { rightsList } from "./reducers/rightsList";

const persistConfig = {
  key: "keywin",
  storage,
  blacklist: ["Login"],
};

const reducer = combineReducers({
  CollapsedReducer: CollapsedReducer,
  Login,
});

const persistedReducer = persistReducer(persistConfig, reducer);

const store = createStore(persistedReducer);
const persistor = persistStore(store);

export { store, persistor };
